import { ApiProperty } from "@nestjs/swagger";
import { IsNotEmpty, IsEmail, IsPhoneNumber } from "class-validator";

/** 登录 */
export class LoginDto {
    @IsNotEmpty({ message: '手机号不能为空' })
    @IsPhoneNumber('CN', { message: '手机号格式不正确' })
    @ApiProperty({
        type: String,
        name: 'mobile',
        description: '手机号',
    })
    public readonly mobile: string;

    @IsNotEmpty({ message: '密码不能为空' })
    @ApiProperty({
        type: String,
        name: 'password',
        description: '密码',
    })
    public readonly password: string;
}
/** 注册账号 */
export class RegisterUserDto {
    @IsNotEmpty({ message: '手机号不能为空' })
    @ApiProperty({
        type: String,
        name: 'mobile',
        description: '手机号',
    })
    public readonly mobile: string;
    @IsNotEmpty({ message: '密码不能为空' })
    @ApiProperty({
        type: String,
        name: 'password',
        description: '密码',
    })
    public readonly password: string;
}
